package com.starview.platform.data;

import com.starview.platform.data.type.IType;

/**
 * The {@link IPattern} interface is implemented by pattern code: pattern abstractions
 * 
 * @author fgm
 * 
 */

public interface IPattern
{
  /**
   * Enter a pattern and return the result as a tuple of extracted values.
   * 
   * @param arg
   *          the value that the pattern will match against
   * 
   * @return null if the pattern fails, otherwise a tuple of IValues representing the extracted
   *         values
   */
  IValue match(IValue arg) throws EvaluationException;

  /**
   * All programs expose a means of getting their type
   * 
   * @return
   */
  IType getType();
}
